#include <57header.h>

void fun(int num){
    printf("fun run \n");
}
int main(int argc,char*argv[])
{
    
    struct sigaction act, old;
    memset(&act, 0, sizeof(act));
    memset(&old, 0, sizeof(old));

    act.sa_flags = SA_RESTART;
    act.sa_handler = fun;

    sigaction(2, &act, &old);


    char buf[1024] = {0};
    int res = read(STDIN_FILENO, buf, sizeof(buf));
    printf("res: %d, buf: %s \n", res, buf);

    return 0;
}

